//
// Created by hjie on 23-6-24.
//

#include "data_manager.h"
#include "sdp_data.h"
#include "user_data.h"
#include "user_association.h"
#include "user_data_manager.h"
#include "user_association_manager.h"

DataManager::DataManager(ConnectionDataRoom *room)
{
    m_room = room;
    m_ua_mgr = std::make_shared<UserAssociationManager>(this);
    m_ud_mgr = std::make_shared<UserDataManager>(this);
}

DataManager::~DataManager()
{
    printf("destructor %s.\n", __func__ );
    m_ud_mgr.reset();
    m_ua_mgr.reset();
}

void DataManager::ClearAllData(const std::string &user_id)
{
    m_ua_mgr->RemoveData(user_id);
    m_ud_mgr->RemoveUserById(user_id);
}











